

package com.wondertek.poms.service.controller;

import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
import com.wondertek.poms.common.controller.BaseController;
import com.wondertek.poms.common.exception.MessageCodes;
import com.wondertek.poms.common.log.MethodLog;
import com.wondertek.poms.common.utils.StringUtil;
import com.wondertek.poms.common.vo.PageBean;
import com.wondertek.poms.common.vo.ResultBean;
import com.wondertek.poms.core.manager.InPrdInfoManager;
import com.wondertek.poms.core.manager.PrdInfoRuleManager;
import com.wondertek.poms.core.service.IContentBlackService;
import com.wondertek.poms.core.service.IContentService;
import com.wondertek.poms.core.service.IContentWhiteService;
import com.wondertek.poms.core.service.IMediaFileService;
import com.wondertek.poms.core.service.IPrdContService;
import com.wondertek.poms.core.service.IPrdInfoService;
import com.wondertek.poms.core.service.ISystemConfigService;
import com.wondertek.poms.dao.po.Content;
import com.wondertek.poms.dao.po.MediaFile;
import com.wondertek.poms.dao.po.PrdCont;
import com.wondertek.poms.dao.po.PrdInfo;
import com.wondertek.poms.dao.pojo.ContentPojo;
import com.wondertek.poms.dao.vo.PrdContDetailVo;
import com.wondertek.poms.service.vo.ContentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;


@Api("")
@RestController
@Scope("prototype")
@RequestMapping(value="/content")
@Slf4j
public class ContentController extends BaseController {

	@Autowired
	private IContentService contentService;
	@Autowired
	private IMediaFileService mediaFileService;
	@Autowired
	private ISystemConfigService systemConfigService;
	@Autowired
	private IPrdInfoService prdInfoService;
	@Autowired
	public IContentBlackService contentBlackService;
	@Autowired
	public IContentWhiteService contentWhiteService;
	@Autowired
	private IPrdContService prdContService;
	@Autowired
	private InPrdInfoManager inPrdInfoManager;
	@Autowired
	private PrdInfoRuleManager proInfoRuleManage;


	@ApiOperation("列表")
	@GetMapping("/list")
	@MethodLog(module = "内容列表")
	public ResultBean list(HttpServletRequest request,
						   ContentVo contentVo,
						   @RequestParam(defaultValue = "1") int page,
						   @RequestParam(defaultValue = "20") int rows,
						   @RequestParam(defaultValue = "LAST_MODIFY_TIME") String sidx,
						   @RequestParam(defaultValue = "desc") String sord) {
		ContentPojo contentPojo = new ContentPojo();
		BeanUtils.copyProperties(contentVo, contentPojo);

		Page<ContentPojo> pages = contentService
				.findAll(contentPojo, page, rows, sord, sidx);

		return PageBean.ok(pages.getTotalPages(), pages.getTotalElements(), pages.getContent());
	}

	@ApiOperation("详情")
	@ApiImplicitParam(name = "id", required = true, paramType = "query", dataType = "Long")
	@GetMapping(value = "/get")
	@MethodLog(module = "内容详情")
	public ResultBean get(Long id) throws IOException {
		PrdContDetailVo content = contentService.findPrdContDetailVo(id.toString());
		return ResultBean.ok(content);
	}

	@ApiOperation("已进商品包列表")
	@GetMapping("/list-content")
	@MethodLog(module = "已进商品包列表")
	public ResultBean list(String contentId) {
		return PageBean.ok(contentService.getPrdContList(contentId));
	}

	@GetMapping(value = "/has-in-prdInfos")
	@ResponseBody
	public ResultBean hasInPrdInfos(String contentId){

		return ResultBean.ok();
	}

	@GetMapping(value = "/get-media-list")
	@ResponseBody
	public ResultBean getMediaList(String contentId){
		if(StrUtil.isBlank(contentId)){
			return ResultBean.error(MessageCodes.get(MessageCodes.M980203));
		}
		List<MediaFile> mediaFileList=new ArrayList<>();
		List<MediaFile> list=mediaFileService.findListByContent(contentId);
		for(MediaFile mediaFile:list){
			updateResolution(mediaFile);
			updateMediaFile(mediaFile, mediaFileList);
		}
		return ResultBean.ok(mediaFileList);
	}

	@GetMapping(value = "/get-txt-detail")
	@ResponseBody
	public ResultBean getTxtDetail(String contentId){
		InputStream inputStream;
		String localPath = "";
		Content content = contentService.findByContentId(contentId);
		if(content!=null && content.getId()!=null) {
			String metadataPathOption = systemConfigService.findAllBykey("STORE_PATH_OPTION").getValue();//元数据存储路径选项 ：0-原始存储路径， 1-poms存储路径
			if("1".equals(metadataPathOption)) {
				localPath = systemConfigService.findAllBykey("poms_syncFile_basePath").getValue() + "/zhengshi" +  contentIdToPath(contentId) + "news/news.html";
			}else {
				localPath = systemConfigService.findAllBykey("syncFile_basePath").getValue() + "/zhengshi" + contentIdToPath(contentId) + "news/news.html";
			}
		}

		File htmlFile = new File(localPath);
		if(htmlFile.exists() && htmlFile.isFile()) {
			try {
				inputStream = new FileInputStream(htmlFile);
			} catch (FileNotFoundException e) {
				e.printStackTrace();
				return ResultBean.error(e.getMessage());
			}
		}
		return ResultBean.ok();
	}

	@GetMapping(value = "/in-prdInfo")
	@ResponseBody
	public ResultBean inPrdInfo(String contentId,String prdInfoId) {
		Content content = contentService.findByContentId(contentId);
		PrdInfo prdInfo = prdInfoService.getByPrdInfoIdAndSystemFlag(Convert.toLong(prdInfoId));
		List<PrdCont> prdContList = new ArrayList<>();
		//入包前判斷
		String msg = inPrdInfoManager.inPrdInfoRule(content, prdInfo, prdContList);
		if (StringUtils.isNotBlank(msg)) {
			return ResultBean.error(msg);
		}
		//入包操作
		inPrdInfoManager.inPrdInfoProcess(content, prdInfo);
		// 子集入包
		inPrdInfoManager.subSetToNewPrdInfo(Convert.toLong(prdInfoId), prdContList, content);
		return ResultBean.ok();
	}






	public String contentIdToPath(String contentId) {
		if (contentId == null || contentId.equals("") || contentId.trim().length() != 10) {
			throw new RuntimeException();
		}
		return "/" + contentId.substring(0, 4) + "/" + contentId.substring(4, 7) + "/" + contentId.substring(7, 10) + "/" + contentId + "/";
	}

	public void updateMediaFile(MediaFile mediaFile,List<MediaFile> mediaFileList){
		boolean isHwVideoPlay = true;
		String mediaRCConfig = systemConfigService.findAllBykey("MEDIA_RC_CONFIG").getValue();
		if (mediaRCConfig == null || mediaRCConfig.equals("")) {
			log.error("==未配置MEDIA_RC_CONFIG==");
			isHwVideoPlay = (mediaFile.getMediaFilePreviewPath() != null && mediaFile.getMediaFilePreviewPath().indexOf("file:") == -1);
		} else {
			String s = ";" + mediaFile.getMediaType() + "|"
					+ mediaFile.getMediaUsageCode() + ";";
			if ((";" + mediaRCConfig + ";").indexOf(s) > -1) {
				isHwVideoPlay = false;
			}
		}

		String size = mediaFile.getMediaSize();
		if (!StringUtil.isNullStr(size)) {
			mediaFile.setMediaSize(((float) Math.round(((Long.valueOf(size) / (1024.0 * 1024.0)) * 10) / 10)) + "MB");
		}

		mediaFile.setIsHWVideoPlayURL(isHwVideoPlay);
		mediaFileList.add(mediaFile);
	}

	public void updateResolution(MediaFile mediaFile){
		long width;
		long height;
		if (mediaFile.getMediaResolution() == null) {
			width = 480l;
			height = 360l;
			mediaFile.setWidth(width);
			mediaFile.setHeight(height);
			return;
		}

		switch (mediaFile.getMediaResolution()){
			case "01":
				width = 176l;
				height = 144l;
				break;
			case "02":
				width = 240l;
				height = 180l;
				break;
			case "03":
				width = 320l;
				height = 240l;
				break;
			case "04":
				width = 352l;
				height = 288l;
				break;
			case "05":
				width = 400l;
				height = 240l;
				break;
			case "06":
				width = 320l;
				height = 480l;
				break;
			case "07":
				width = 480l;
				height = 360l;
				break;
			case "08":
				width = 640l;
				height = 480l;
				break;
			case "09":
				width = 720l;
				height = 576l;
				break;
			case "10":
				width = 800l;
				height = 480l;
				break;
			case "11":
				width = 1280l;
				height = 720l;
				break;
			case "12":
				width = 1920l;
				height = 1080l;
				break;
			case "13":
				width = 1920l;
				height = 1080l;
				break;
			case "14":
				width = 400l;
				height = 300l;
				break;
			case "15":
				width = 400l;
				height = 320l;
				break;
			case "16":
				width = 720l;
				height = 480l;
				break;
			case "17":
				width = 480l;
				height = 272l;
				break;
			case "18":
				width = 640l;
				height = 360l;
				break;
			case "19":
				width = 1024l;
				height = 576l;
				break;
			case "20":
				width = 854l;
				height = 480l;
				break;
			case "21":
				width = 2560L;
				height = 1440L;
				break;
			case "22":
				width = 3840L;
				height = 2160L;
				break;
			case "23":
				width = 1920L;
				height = 540L;
				break;
			case "24":
				width = 2560L;
				height = 720L;
				break;
			case "25":
				width = 1920L;
				height = 960L;
				break;
			case "26":
				width = 1280L;
				height = 360L;
				break;
			case "27":
				width = 2560L;
				height = 1280L;
				break;
			case "28":
				width = 3840L;
				height = 1920L;
				break;
			default:
				width = 480l;
				height = 360l;
		}
		mediaFile.setWidth(width);
		mediaFile.setHeight(height);
	}




	/*
	@ApiOperation("新增")
	@ApiImplicitParams({
		@ApiImplicitParam(name = "id", required = true),
		@ApiImplicitParam(name = "accessPlatformType", required = true),
		@ApiImplicitParam(name = "area", required = true),
		@ApiImplicitParam(name = "areaId", required = true),
		@ApiImplicitParam(name = "assetId", required = true),
		@ApiImplicitParam(name = "assist", required = true),
		@ApiImplicitParam(name = "auditionRecordsNum", required = true),
		@ApiImplicitParam(name = "author", required = true),
		@ApiImplicitParam(name = "authorizationWay", required = true),
		@ApiImplicitParam(name = "bcId", required = true),
		@ApiImplicitParam(name = "bcLicense", required = true),
		@ApiImplicitParam(name = "bcPriority", required = true),
		@ApiImplicitParam(name = "bcRatio", required = true),
		@ApiImplicitParam(name = "beginDate", required = true),
		@ApiImplicitParam(name = "blackArea", required = true),
		@ApiImplicitParam(name = "businessLicense", required = true),
		@ApiImplicitParam(name = "cacheCdnStatus", required = true),
		@ApiImplicitParam(name = "category", required = true),
		@ApiImplicitParam(name = "cdnStatus", required = true),
		@ApiImplicitParam(name = "cduration", required = true),
		@ApiImplicitParam(name = "chain", required = true),
		@ApiImplicitParam(name = "clarity", required = true),
		@ApiImplicitParam(name = "cmsId", required = true),
		@ApiImplicitParam(name = "contSourceStatus", required = true),
		@ApiImplicitParam(name = "contentId", required = true),
		@ApiImplicitParam(name = "contentLevel", required = true),
		@ApiImplicitParam(name = "contentLists", required = true),
		@ApiImplicitParam(name = "contentPlayTime", required = true),
		@ApiImplicitParam(name = "copy", required = true),
		@ApiImplicitParam(name = "copyrightCpid", required = true),
		@ApiImplicitParam(name = "copyrightObjectId", required = true),
		@ApiImplicitParam(name = "copyrightType", required = true),
		@ApiImplicitParam(name = "copyrightId", required = true),
		@ApiImplicitParam(name = "cpId", required = true),
		@ApiImplicitParam(name = "cpRatio", required = true),
		@ApiImplicitParam(name = "createTime", required = true),
		@ApiImplicitParam(name = "creatorId", required = true),
		@ApiImplicitParam(name = "detail", required = true),
		@ApiImplicitParam(name = "detailCopy", required = true),
		@ApiImplicitParam(name = "directRecFlag", required = true),
		@ApiImplicitParam(name = "displayFileLists", required = true),
		@ApiImplicitParam(name = "displayName", required = true),
		@ApiImplicitParam(name = "displayType", required = true),
		@ApiImplicitParam(name = "distResult", required = true),
		@ApiImplicitParam(name = "docName", required = true),
		@ApiImplicitParam(name = "doubanId", required = true),
		@ApiImplicitParam(name = "endDate", required = true),
		@ApiImplicitParam(name = "feeType", required = true),
		@ApiImplicitParam(name = "formType", required = true),
		@ApiImplicitParam(name = "gslbStatus", required = true),
		@ApiImplicitParam(name = "hasMoved", required = true),
		@ApiImplicitParam(name = "hasVideo", required = true),
		@ApiImplicitParam(name = "images", required = true),
		@ApiImplicitParam(name = "influence", required = true),
		@ApiImplicitParam(name = "integrity", required = true),
		@ApiImplicitParam(name = "isMultiScreen", required = true),
		@ApiImplicitParam(name = "isSupH264", required = true),
		@ApiImplicitParam(name = "isSupRchd", required = true),
		@ApiImplicitParam(name = "isSupRms", required = true),
		@ApiImplicitParam(name = "isSupWap", required = true),
		@ApiImplicitParam(name = "isSupWww", required = true),
		@ApiImplicitParam(name = "isUpdating", required = true),
		@ApiImplicitParam(name = "keyWords", required = true),
		@ApiImplicitParam(name = "keywordsCopy", required = true),
		@ApiImplicitParam(name = "labels", required = true),
		@ApiImplicitParam(name = "lastModifyTime", required = true),
		@ApiImplicitParam(name = "liveType", required = true),
		@ApiImplicitParam(name = "mediaFileLists", required = true),
		@ApiImplicitParam(name = "mediaLevel", required = true),
		@ApiImplicitParam(name = "miguPublish", required = true),
		@ApiImplicitParam(name = "miguRank", required = true),
		@ApiImplicitParam(name = "monthPricing", required = true),
		@ApiImplicitParam(name = "movieLibId", required = true),
		@ApiImplicitParam(name = "name", required = true),
		@ApiImplicitParam(name = "nameCopy", required = true),
		@ApiImplicitParam(name = "nCpid", required = true),
		@ApiImplicitParam(name = "needDrm", required = true),
		@ApiImplicitParam(name = "onlineTime", required = true),
		@ApiImplicitParam(name = "optimal", required = true),
		@ApiImplicitParam(name = "oriPublish", required = true),
		@ApiImplicitParam(name = "output", required = true),
		@ApiImplicitParam(name = "playbillFilePath", required = true),
		@ApiImplicitParam(name = "pricing", required = true),
		@ApiImplicitParam(name = "primaryKeyWord", required = true),
		@ApiImplicitParam(name = "priority", required = true),
		@ApiImplicitParam(name = "productIds", required = true),
		@ApiImplicitParam(name = "publish", required = true),
		@ApiImplicitParam(name = "recommendation", required = true),
		@ApiImplicitParam(name = "recommendationCopy", required = true),
		@ApiImplicitParam(name = "rightType", required = true),
		@ApiImplicitParam(name = "scarcity", required = true),
		@ApiImplicitParam(name = "sceneFiles", required = true),
		@ApiImplicitParam(name = "scope", required = true),
		@ApiImplicitParam(name = "score", required = true),
		@ApiImplicitParam(name = "sequence", required = true),
		@ApiImplicitParam(name = "serialContentId", required = true),
		@ApiImplicitParam(name = "serialCount", required = true),
		@ApiImplicitParam(name = "serialSequence", required = true),
		@ApiImplicitParam(name = "serialTrailingSequence", required = true),
		@ApiImplicitParam(name = "shortName", required = true),
		@ApiImplicitParam(name = "stage", required = true),
		@ApiImplicitParam(name = "status", required = true),
		@ApiImplicitParam(name = "support", required = true),
		@ApiImplicitParam(name = "syncFilePath", required = true),
		@ApiImplicitParam(name = "terminal", required = true),
		@ApiImplicitParam(name = "tvEndDate", required = true),
		@ApiImplicitParam(name = "type", required = true),
		@ApiImplicitParam(name = "udid", required = true),
		@ApiImplicitParam(name = "unitPricing", required = true),
		@ApiImplicitParam(name = "updateFields", required = true),
		@ApiImplicitParam(name = "version", required = true),
		@ApiImplicitParam(name = "waterMask", required = true),
		@ApiImplicitParam(name = "way", required = true),
		@ApiImplicitParam(name = "worksType", required = true),
		@ApiImplicitParam(name = "movedPlatform", required = true),
		@ApiImplicitParam(name = "webpFlag", required = true),
		@ApiImplicitParam(name = "lastTranscodeTime", required = true),
		@ApiImplicitParam(name = "miguDbid", required = true),
		@ApiImplicitParam(name = "mvId", required = true),
		@ApiImplicitParam(name = "mpId", required = true),
		@ApiImplicitParam(name = "mcId", required = true),
		@ApiImplicitParam(name = "liveContentId", required = true),
		@ApiImplicitParam(name = "playBillEndTime", required = true),
		@ApiImplicitParam(name = "playBillStartTime", required = true),
		@ApiImplicitParam(name = "contentMediaStatus", required = true),
		@ApiImplicitParam(name = "dialect", required = true),
		@ApiImplicitParam(name = "streamId", required = true),
		@ApiImplicitParam(name = "contentMediaReason", required = true),
		@ApiImplicitParam(name = "cdiId", required = true),
		@ApiImplicitParam(name = "checkStatus", required = true),
		@ApiImplicitParam(name = "hotContId", required = true),
		@ApiImplicitParam(name = "isEnforePreview", required = true),
		@ApiImplicitParam(name = "isLock", required = true),
		@ApiImplicitParam(name = "isOutput", required = true),
		@ApiImplicitParam(name = "ispublished", required = true),
		@ApiImplicitParam(name = "isSupRcHd", required = true),
		@ApiImplicitParam(name = "nodeId", required = true),
		@ApiImplicitParam(name = "publishTime", required = true),
		@ApiImplicitParam(name = "remarkText", required = true),
		@ApiImplicitParam(name = "tags", required = true),
		@ApiImplicitParam(name = "updateTime", required = true),
		@ApiImplicitParam(name = "userId", required = true),
		@ApiImplicitParam(name = "userName", required = true),
		@ApiImplicitParam(name = "inputUserid", required = true),
		@ApiImplicitParam(name = "isPrivate", required = true),
		@ApiImplicitParam(name = "keyWordsCopy", required = true),
		@ApiImplicitParam(name = "miguDbId", required = true),
		@ApiImplicitParam(name = "isPublishFirst", required = true),
		@ApiImplicitParam(name = "superBcId", required = true),
		@ApiImplicitParam(name = "superBcType", required = true),
		@ApiImplicitParam(name = "svId", required = true),
		@ApiImplicitParam(name = "dataObjId", required = true),
		@ApiImplicitParam(name = "preRecord", required = true),
		@ApiImplicitParam(name = "thumbViewer", required = true),
		@ApiImplicitParam(name = "liveScreenShot", required = true),
		@ApiImplicitParam(name = "isMultilinGual", required = true),
	})
	@PostMapping(value = "/add")
	@ResponseBody
	//TODO (需要删除不需要的属性列)
	public ResultBean add(HttpServletRequest request, ContentVo contentVo) {
		List<String> messageList = ValidateFilter.getFilterMessage(contentVo, Constants.VALIDATE_DEFAULT);
		if (!messageList.isEmpty()) {
			return ResultBean.error(messageList.toString());
		}
		
		if (isRepeat(contentVo)) 
			return ResultBean.error(MessageCodes.get(MessageCodes.M980202));
	
		Content content = new Content();
		BeanUtils.copyProperties(contentVo, content);
		
		//content.putTimeAndUser(content);
		contentService.save(content);
		return ResultBean.ok(content);
	}
	
	*/
/**
 * <p><b>Title:</b> isRepeat</p>
 * <p><b>Description:</b> 判断名称是否重复</p>
 * @author douzi
 * @param contentVo
 *//*

	private boolean isRepeat(ContentVo contentVo) {
		*/
/*Content temp = new Content();
		temp.setName(contentVo.getName());
		Optional<Content> contentOpt = contentService.findOne(Example.of(temp));
		if (contentOpt.isPresent()) {
			Content content = contentOpt.get();
			if (contentVo.getId() != null && contentVo.getId() != content.getId())
				return true;
			else if (contentVo.getId() == null)
				return true;
		}*//*

		return false;
	}
	
	@ApiOperation("详情")
	@ApiImplicitParam(name = "id", required = true, paramType = "query", dataType = "Long")
	@GetMapping(value = "/get")
	@ResponseBody
	public ResultBean get(Long id) {
		Content content = contentService.get(id);
		return ResultBean.ok(content);
	}
	
	@ApiOperation("变更")
	@ApiImplicitParams({
		@ApiImplicitParam(name = "id", required = true),
		@ApiImplicitParam(name = "accessPlatformType", required = true),
		@ApiImplicitParam(name = "area", required = true),
		@ApiImplicitParam(name = "areaId", required = true),
		@ApiImplicitParam(name = "assetId", required = true),
		@ApiImplicitParam(name = "assist", required = true),
		@ApiImplicitParam(name = "auditionRecordsNum", required = true),
		@ApiImplicitParam(name = "author", required = true),
		@ApiImplicitParam(name = "authorizationWay", required = true),
		@ApiImplicitParam(name = "bcId", required = true),
		@ApiImplicitParam(name = "bcLicense", required = true),
		@ApiImplicitParam(name = "bcPriority", required = true),
		@ApiImplicitParam(name = "bcRatio", required = true),
		@ApiImplicitParam(name = "beginDate", required = true),
		@ApiImplicitParam(name = "blackArea", required = true),
		@ApiImplicitParam(name = "businessLicense", required = true),
		@ApiImplicitParam(name = "cacheCdnStatus", required = true),
		@ApiImplicitParam(name = "category", required = true),
		@ApiImplicitParam(name = "cdnStatus", required = true),
		@ApiImplicitParam(name = "cduration", required = true),
		@ApiImplicitParam(name = "chain", required = true),
		@ApiImplicitParam(name = "clarity", required = true),
		@ApiImplicitParam(name = "cmsId", required = true),
		@ApiImplicitParam(name = "contSourceStatus", required = true),
		@ApiImplicitParam(name = "contentId", required = true),
		@ApiImplicitParam(name = "contentLevel", required = true),
		@ApiImplicitParam(name = "contentLists", required = true),
		@ApiImplicitParam(name = "contentPlayTime", required = true),
		@ApiImplicitParam(name = "copy", required = true),
		@ApiImplicitParam(name = "copyrightCpid", required = true),
		@ApiImplicitParam(name = "copyrightObjectId", required = true),
		@ApiImplicitParam(name = "copyrightType", required = true),
		@ApiImplicitParam(name = "copyrightId", required = true),
		@ApiImplicitParam(name = "cpId", required = true),
		@ApiImplicitParam(name = "cpRatio", required = true),
		@ApiImplicitParam(name = "createTime", required = true),
		@ApiImplicitParam(name = "creatorId", required = true),
		@ApiImplicitParam(name = "detail", required = true),
		@ApiImplicitParam(name = "detailCopy", required = true),
		@ApiImplicitParam(name = "directRecFlag", required = true),
		@ApiImplicitParam(name = "displayFileLists", required = true),
		@ApiImplicitParam(name = "displayName", required = true),
		@ApiImplicitParam(name = "displayType", required = true),
		@ApiImplicitParam(name = "distResult", required = true),
		@ApiImplicitParam(name = "docName", required = true),
		@ApiImplicitParam(name = "doubanId", required = true),
		@ApiImplicitParam(name = "endDate", required = true),
		@ApiImplicitParam(name = "feeType", required = true),
		@ApiImplicitParam(name = "formType", required = true),
		@ApiImplicitParam(name = "gslbStatus", required = true),
		@ApiImplicitParam(name = "hasMoved", required = true),
		@ApiImplicitParam(name = "hasVideo", required = true),
		@ApiImplicitParam(name = "images", required = true),
		@ApiImplicitParam(name = "influence", required = true),
		@ApiImplicitParam(name = "integrity", required = true),
		@ApiImplicitParam(name = "isMultiScreen", required = true),
		@ApiImplicitParam(name = "isSupH264", required = true),
		@ApiImplicitParam(name = "isSupRchd", required = true),
		@ApiImplicitParam(name = "isSupRms", required = true),
		@ApiImplicitParam(name = "isSupWap", required = true),
		@ApiImplicitParam(name = "isSupWww", required = true),
		@ApiImplicitParam(name = "isUpdating", required = true),
		@ApiImplicitParam(name = "keyWords", required = true),
		@ApiImplicitParam(name = "keywordsCopy", required = true),
		@ApiImplicitParam(name = "labels", required = true),
		@ApiImplicitParam(name = "lastModifyTime", required = true),
		@ApiImplicitParam(name = "liveType", required = true),
		@ApiImplicitParam(name = "mediaFileLists", required = true),
		@ApiImplicitParam(name = "mediaLevel", required = true),
		@ApiImplicitParam(name = "miguPublish", required = true),
		@ApiImplicitParam(name = "miguRank", required = true),
		@ApiImplicitParam(name = "monthPricing", required = true),
		@ApiImplicitParam(name = "movieLibId", required = true),
		@ApiImplicitParam(name = "name", required = true),
		@ApiImplicitParam(name = "nameCopy", required = true),
		@ApiImplicitParam(name = "nCpid", required = true),
		@ApiImplicitParam(name = "needDrm", required = true),
		@ApiImplicitParam(name = "onlineTime", required = true),
		@ApiImplicitParam(name = "optimal", required = true),
		@ApiImplicitParam(name = "oriPublish", required = true),
		@ApiImplicitParam(name = "output", required = true),
		@ApiImplicitParam(name = "playbillFilePath", required = true),
		@ApiImplicitParam(name = "pricing", required = true),
		@ApiImplicitParam(name = "primaryKeyWord", required = true),
		@ApiImplicitParam(name = "priority", required = true),
		@ApiImplicitParam(name = "productIds", required = true),
		@ApiImplicitParam(name = "publish", required = true),
		@ApiImplicitParam(name = "recommendation", required = true),
		@ApiImplicitParam(name = "recommendationCopy", required = true),
		@ApiImplicitParam(name = "rightType", required = true),
		@ApiImplicitParam(name = "scarcity", required = true),
		@ApiImplicitParam(name = "sceneFiles", required = true),
		@ApiImplicitParam(name = "scope", required = true),
		@ApiImplicitParam(name = "score", required = true),
		@ApiImplicitParam(name = "sequence", required = true),
		@ApiImplicitParam(name = "serialContentId", required = true),
		@ApiImplicitParam(name = "serialCount", required = true),
		@ApiImplicitParam(name = "serialSequence", required = true),
		@ApiImplicitParam(name = "serialTrailingSequence", required = true),
		@ApiImplicitParam(name = "shortName", required = true),
		@ApiImplicitParam(name = "stage", required = true),
		@ApiImplicitParam(name = "status", required = true),
		@ApiImplicitParam(name = "support", required = true),
		@ApiImplicitParam(name = "syncFilePath", required = true),
		@ApiImplicitParam(name = "terminal", required = true),
		@ApiImplicitParam(name = "tvEndDate", required = true),
		@ApiImplicitParam(name = "type", required = true),
		@ApiImplicitParam(name = "udid", required = true),
		@ApiImplicitParam(name = "unitPricing", required = true),
		@ApiImplicitParam(name = "updateFields", required = true),
		@ApiImplicitParam(name = "version", required = true),
		@ApiImplicitParam(name = "waterMask", required = true),
		@ApiImplicitParam(name = "way", required = true),
		@ApiImplicitParam(name = "worksType", required = true),
		@ApiImplicitParam(name = "movedPlatform", required = true),
		@ApiImplicitParam(name = "webpFlag", required = true),
		@ApiImplicitParam(name = "lastTranscodeTime", required = true),
		@ApiImplicitParam(name = "miguDbid", required = true),
		@ApiImplicitParam(name = "mvId", required = true),
		@ApiImplicitParam(name = "mpId", required = true),
		@ApiImplicitParam(name = "mcId", required = true),
		@ApiImplicitParam(name = "liveContentId", required = true),
		@ApiImplicitParam(name = "playBillEndTime", required = true),
		@ApiImplicitParam(name = "playBillStartTime", required = true),
		@ApiImplicitParam(name = "contentMediaStatus", required = true),
		@ApiImplicitParam(name = "dialect", required = true),
		@ApiImplicitParam(name = "streamId", required = true),
		@ApiImplicitParam(name = "contentMediaReason", required = true),
		@ApiImplicitParam(name = "cdiId", required = true),
		@ApiImplicitParam(name = "checkStatus", required = true),
		@ApiImplicitParam(name = "hotContId", required = true),
		@ApiImplicitParam(name = "isEnforePreview", required = true),
		@ApiImplicitParam(name = "isLock", required = true),
		@ApiImplicitParam(name = "isOutput", required = true),
		@ApiImplicitParam(name = "ispublished", required = true),
		@ApiImplicitParam(name = "isSupRcHd", required = true),
		@ApiImplicitParam(name = "nodeId", required = true),
		@ApiImplicitParam(name = "publishTime", required = true),
		@ApiImplicitParam(name = "remarkText", required = true),
		@ApiImplicitParam(name = "tags", required = true),
		@ApiImplicitParam(name = "updateTime", required = true),
		@ApiImplicitParam(name = "userId", required = true),
		@ApiImplicitParam(name = "userName", required = true),
		@ApiImplicitParam(name = "inputUserid", required = true),
		@ApiImplicitParam(name = "isPrivate", required = true),
		@ApiImplicitParam(name = "keyWordsCopy", required = true),
		@ApiImplicitParam(name = "miguDbId", required = true),
		@ApiImplicitParam(name = "isPublishFirst", required = true),
		@ApiImplicitParam(name = "superBcId", required = true),
		@ApiImplicitParam(name = "superBcType", required = true),
		@ApiImplicitParam(name = "svId", required = true),
		@ApiImplicitParam(name = "dataObjId", required = true),
		@ApiImplicitParam(name = "preRecord", required = true),
		@ApiImplicitParam(name = "thumbViewer", required = true),
		@ApiImplicitParam(name = "liveScreenShot", required = true),
		@ApiImplicitParam(name = "isMultilinGual", required = true),
	})
	@PutMapping(value = "/edit")
	@ResponseBody
	//TODO (需要删除不需要的属性列)
	public ResultBean update(HttpServletRequest request, ContentVo contentVo) {
		List<String> messageList = ValidateFilter.getFilterMessage(contentVo, Constants.VALIDATE_UPDATE);
		if (!messageList.isEmpty()) {
			return ResultBean.error(messageList.toString());
		}
		
		*/
/*if (isRepeat(contentVo))
			return ResultBean.error(MessageCodes.get(MessageCodes._900001));*//*

		
		Content content = new Content();
		BeanUtils.copyProperties(contentVo, content);
		return ResultBean.ok(contentService.merge(content));
	}
	
	@ApiOperation("删除")
	@ApiImplicitParam(name = "id", required = true, paramType = "query", dataType = "Long")
	@DeleteMapping(value = "/del")
	@ResponseBody
	public ResultBean delete(Long id) {
		contentService.deleteById(id);
		return ResultBean.ok();
	}

*/
}